<?php
$title		= ChoiseOption;
$step=2;

if($actPost=="choisepackage")
{
	$hasPackage	= false;
	$listdomain	= gpc_getStringArray("Domain");
	$domain_opt = gpc_getStringArray("DomainOption");	
	$hosting_opt= gpc_getStringPost("HostingOption");
	
	//save hosting options to session:
	$hosting_opt=explode(",",$hosting_opt);
	if(count($hosting_opt)==2)
	{
		$hasPackage	= true;
		gpc_setSession("HostingOption",$hosting_opt);
	}else 
	{
		gpc_setSession("HostingOption",array());
	}
	
	//save domain to session:
	$dtsDomain=array();
	foreach ($listdomain as $i => $domain)
	{
		if($domain_opt[$i]=="tranfer")
		{
			$dtsDomain[$i]['name']	= $domain;
			$dtsDomain[$i]['year']	= $domain_opt[$i];
			
		}else if($domain_opt[$i]>0)
		{
			$hasPackage	= true;
			$dtsDomain[$i]['name']	= $domain;
			$dtsDomain[$i]['year']	= $domain_opt[$i];
		}
		
	}
	if($hasPackage==true)
	{
		
		gpc_setSession("DomainOption",$dtsDomain);	
		Redirect($folder_path_root."checkout/");
		
	}else 
	{
		$msg_error=Choise1Package;
	}
}

$hosting 	= gpc_getSession("Hosting");
$listdomain	= gpc_getSession("ListDomain");

if(!is_array($listdomain))
{
	Redirect($folder_path_root."signup/");
}
?>